package main

import (
	"github.com/urfave/cli"
	"go-zero-demo/app/datacenter/cron/internal/cmd"
	"go-zero-demo/app/datacenter/cron/internal/cmd/cron"
	"go-zero-demo/app/datacenter/cron/internal/cmd/migrate"
	"go-zero-demo/app/datacenter/cron/internal/cmd/sync2ck"
	"os"
)

func main() {
	app := cli.NewApp()
	app.Name = "cron"
	app.Usage = "cron Server"
	//app.Version = conf.App.Version
	app.Flags = []cli.Flag{
		cmd.StringFlag("config, c", "etc/cron.yaml", "Custom configuration file path"),
	}
	app.Commands = []cli.Command{
		cron.Cron,
		migrate.Migrate,
		sync2ck.Sync2ck,
	}
	if err := app.Run(os.Args); err != nil {
		//log.Fatal("Failed to start application: %v", err)
		panic(err)
	}
}
